<link type="text/css" rel="stylesheet" href="css/services.css"/>
<div class="container">
		<h1>Thông tin khách hàng</h1>
<script type="text/javascript">
	$(function() {
		$("#xemthem").click(function(){
			$.ajax({
				type: 'post',
				url: '<?php echo base_url()?>customer/getmorehistory',
				data: {historypage: $("#historypage").val(),
						Cust_ID: $("input[name='Cust_ID']").val()
					},
				success: function(data){
						 var R = eval('(' + data + ')'); 
						 $("#more-html").append(R.html);
						 // console.log(R.sql);
						 $("#historypage").val(R.historypage);
				},
				statusCode:{
					404: function(){
						
					}
				}
			});
		});
	});
</script>
<?php     

echo form_open(current_url()); ?>
		<div id = "top_reserve">
			<div id = "content-right" class="action">
			
			<div>
			<p> 
                            <input type="image" id="button_submit" name="button_submit" value="Lưu" class="imageButtonSmall"/>
		<?php 
		$data = array(
			'name' => 'button_cancel',
			'id' => 'button_cancel',
			'value' => 'true',
			'type' => 'button',
			'content' => 'Hủy',
			'onclick'=>"history.go(-1);return false;"
		);

		echo form_button($data);
		?>
</p></div> <!-- end opt_box -->
			</div> <!-- end add_new -->
		</div> <!-- end top_reserve -->	
<div style="width:500px;margin:0 auto;">
<?php echo $custom_error; ?>
<?php echo form_hidden('Cust_ID',$result->Cust_ID) ?>
<span style=" clear:both; float:left; padding:5px;">
                <p><label style="float: left; text-align: right; margin-right: 5px; width: 135px;" for="F_Name">Họ<span class="required"><font color="red">*</font></span></label>                                
                <input id="F_Name" type="text" name="F_Name" value="<?php echo $result->F_Name ?>"  />
                <?php echo form_error('F_Name','<div>','</div>'); ?>
                </p></span>
<span style=" clear:both; float:left; padding:5px;">
                <p><label style="float: left; text-align: right; margin-right: 5px; width: 135px;" for="L_Name">Tên<span class="required"><font color="red">*</font></span></label>                                
                <input id="L_Name" type="text" name="L_Name" value="<?php echo $result->L_Name ?>"  />
                <?php echo form_error('L_Name','<div>','</div>'); ?>
                </p></span>
<span style=" clear:both; float:left; padding:5px;">
                <p><label style="float: left; text-align: right; margin-right: 5px; width: 135px;" for="DOB">Ngày sinh</label>                                
                <input id="DOB" type="text" name="DOB" value="<?php echo $result->DOB ?>"  />
                <?php echo form_error('DOB','<div>','</div>'); ?>
                </p></span>
<span style=" clear:both; float:left; padding:5px;">
                <p><label style="float: left; text-align: right; margin-right: 5px; width: 135px;" for="Phone_NO">Số đt</label>                                
                <input id="Phone_NO" type="text" name="Phone_NO" value="<?php echo $result->Phone_NO ?>"  />
                <?php echo form_error('Phone_NO','<div>','</div>'); ?>
                </p></span>
<span style=" clear:both; float:left; padding:5px;">
                <p><label style="float: left; text-align: right; margin-right: 5px; width: 135px;" for="Street">Địa chỉ</label>                                
                <input id="Street" type="text" name="Street" value="<?php echo $result->Street ?>"  />
                <?php echo form_error('Street','<div>','</div>'); ?>
                </p></span>
<span style=" clear:both; float:left; padding:5px;">
                <p><label style="float: left; text-align: right; margin-right: 5px; width: 135px;" for="District_City">Quận</label>                                
                <input id="District_City" type="text" name="District_City" value="<?php echo $result->District_City ?>"  />
                <?php echo form_error('District_City','<div>','</div>'); ?>
                </p></span>
<span style=" clear:both; float:left; padding:5px;">
                <p><label style="float: left; text-align: right; margin-right: 5px; width: 135px;" for="Membership_Type">Loại khách hàng</label>                                
                <input id="Membership_Type" type="text" name="Membership_Type" value="<?php echo $result->Membership_Type ?>"  />
                <?php echo form_error('Membership_Type','<div>','</div>'); ?>
                </p></span>
<span style=" clear:both; float:left; padding:5px;">
                <p><label style="float: left; text-align: right; margin-right: 5px; width: 135px;" for="Email_Addr">Email</label>                                
                <input id="Email_Addr" type="text" name="Email_Addr" value="<?php echo $result->Email_Addr ?>"  />
                <?php echo form_error('Email_Addr','<div>','</div>'); ?>
                </p></span>
<span style=" clear:both; float:left; padding:5px;">
                <p><label style="float: left; text-align: right; margin-right: 5px; width: 135px;" for="Email_Addr">Ghi chú</label>   
				<textarea cols="50" rows="8" id="Notes" name="Notes"><?php echo $result->Notes; ?></textarea>                
                <?php echo form_error('Notes','<div>','</div>'); ?>
                </p></span>
				<span style=" clear:both;padding:5px;">
				<center><a style="color:#000;" href="<?php echo base_url();?>transaction/index/<?php echo $result->Cust_ID;?>">Giao dịch</a></center> </span>
</div>
<?php echo form_close(); ?>
<?php if(!empty($history)){ ?>
    <p style="clear: both; margin: 10px; float: left; text-align: left;">- <?php echo date("d/m/Y",$history[0]['Create_Dt']);?><br/>- dịch vụ: <?php echo $history[0]['Serv_FullName'];?><br/>- nguời típ: <?php echo $history[0]['EE_Name'];?><br/>- giá: <?php echo formatcurrency($history[0]['Price']*1000);?><br/>- giảm: <?php echo $history[0]['Discount_Percent'];?>%<br/>- thành tiền: <?php echo formatcurrency($history[0]['Money']*1000);?></p>
	<div id="more-html" style="clear:both;"></div>
	<div id="xemthem" style="cursor:pointer;clear:both;float:left;">Xem thêm <input type="hidden" id="historypage" name="historypage" value="1" /></div>
<?php } ?>
	</div>
	
</div>
